package com.magus.project.yddemo.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import springfox.documentation.annotations.ApiIgnore;

@ApiIgnore
@Controller("WidgetView_project_yddemo")
@RequestMapping("/widgets")
public class _WidgetViewController {

	@GetMapping("/yddemo/days")
	public String days(@RequestParam(required = false) String title, ModelMap model) {
		if (title == null) {
			title = "测试：输入的title为NULL";
		}
		model.addAttribute("title", title);
		return "/widget/project-yddemo/day";
	}
	@GetMapping("/yddemo/months")
	public String months(@RequestParam(required = false) String title, ModelMap model) {
		if (title == null) {
			title = "测试：输入的title为NULL";
		}
		model.addAttribute("title", title);
		return "/widget/project-yddemo/month";
	}
	@GetMapping("/yddemo/years")
	public String year(@RequestParam(required = false) String title, ModelMap model) {
		if (title == null) {
			title = "测试：输入的title为NULL";
		}
		model.addAttribute("title", title);
		return "/widget/project-yddemo/year";
	}

}
